home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / tchk21.arc / INCLUDE.ARC / STRINGHK.H < prev    next >
C/C++ Source or Header  |  1989-06-20  |  3KB  |  49 lines

  1. /* TCHK 2.1 - Howard Kapustein's Turbo C library        6-6-89      */
  2. /* Copyright (C) 1988,1989 Howard Kapustein.  All rights reserved.  */
  3.  
  4. /* stringhk.h  -  Howard Kapustein's string header file */
  5.  
  6. #ifndef STRINGHK_HEADER
  7. #define STRINGHK_HEADER 1
  8.  
  9. #include <howard.h>
  10.  
  11. #define endstri(s)      (strlen(s)-1)      /* end of string, integer */
  12. #define endstrp(s)      (s+endstri(s))     /* end of string, pointer */
  13.  
  14. /* function prototypes */
  15. int intlen(char *number);       /* find length of integer part of string */
  16. char *strcomma(char *source);   /* convert a string to xx,xxx,xxx format */
  17. char *strtodol(char *source);   /* convert string to $ format */
  18. char *ltrim(char *source);             /* trim blanks on left */
  19. char *rtrim(char *source);             /* trim blanks on right */
  20. char *atrim(char *source);             /* trim blanks on left & right */
  21. char *strins(char *source, char *new, char *ptr);      /* string insert */
  22. char *strdel(char *source, char *old); /* string delete */
  23. char *strrep(char c, int len);         /* replicate c len times */
  24. char *strfill(char *str, char c, int count);    /* fill string str with c count times */
  25. char *leftstr(char *source, int len);  /* LEFT$(SOURCE$,len) */
  26. char *rightstr(char *source, int len); /* RIGHT$(SOURCE$,len) */
  27. char *midstr(char *source, int begin, int len);  /* MID$(SOURCE$,begin,len) */
  28. char *strshleft(char *source, int count);    /* shift string left count chars */
  29. char *strshright(char *source, int count);   /* shift string right count chars */
  30. char *strclean(char *str);             /* remove non-printable ASCII codes */
  31. char *strcapital(char *str);           /* capitalize first letter of each word */
  32. int stroccur(char *str, char *substr); /* # occurences of substring in string */
  33. int strwcmp(char *wstr, char *str);    /* compare wildcard w/string (*,?) */
  34. int strwicmp(char *wstr, char *str);   /* compare wildcard w/string (*,?), ignore case */
  35. char *strtocomma(char *source);   /* convert a string to xx,xxx,xxx format */
  36. char *strtabexpand(char *source, char *dest, int tablen);   /* expand TABs to tablen SPACEs */
  37. char *strspace2tab(char *source, char *dest, int tablen);   /* compress tablen SPACEs to TABs */
  38. boolean iswildcarded(char *str);        /* does str have wildcards in it */
  39. boolean isallalpha(char *str);          /* are all chars in string alphabetic */
  40. boolean isallalphanum(char *str);       /* are all chars in string alphanumeric */
  41. boolean isallupper(char *str);          /* are all chars in string upper case */
  42. boolean isalllower(char *str);          /* are all chars in string lower case */
  43. char *strpadleft(char *str, char c, int len);   /* pad the left of str of c len times */
  44. char *strpadright(char *str, char c, int len);  /* pad the right of str of c len times */
  45. char *soundex(char *str, char *soundexstr);     /* Soundex code */
  46. char *strsetsz(char **str, int len);    /* adjust length of string by truncating/padding */
  47.  
  48. #endif              /* STRINGHK_HEADER */
  49.